<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>

<xsl:template match="/">
<html>
  <body>
   <center>
		<h1>Результат параметрической адаптации</h1>
   </center>
   <br/>
   <h2>Общие сведения</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th rowspan="2">Дата</th>
        <th rowspan="2">Кол. эксп.</th>
        <th rowspan="2">Алгоритм</th>
        <th colspan="3">Конфигурация</th>
        <th rowspan="2">Метод</th>
        <th rowspan="2">Время выполнения адаптации</th>
        <th rowspan="2">Размер файлов</th>
        <th rowspan="2">Размер архива с рек. пар-ми</th>
        <th rowspan="2">Размер архива с подобр. пар-ми</th>
        <th rowspan="2">Sup время</th>
        <th rowspan="2">Sup исп. файла </th>
        <th rowspan="2">Reg время</th>
        <th rowspan="2">Reg исп. файла</th>
	  </tr>
	  <tr>
		    <th>CPU</th>
		    <th>HDD</th>
		    <th>RAM</th>
	 </tr>
	  <xsl:for-each select="Result">
	  <tr>
		<td><xsl:value-of select="Date1"/></td>
    <td><xsl:value-of select="ExperimentCount1"/></td>
		<td><xsl:value-of select="AlgName1"/></td>
		<td><xsl:value-of select="Config/Processor"/></td>
		<td><xsl:value-of select="Config/Hdd"/></td>
		<td><xsl:value-of select="Config/Memory"/></td>
    <td><xsl:value-of select="MethodName1"/></td>
    <td><xsl:value-of select="ElapsedTime1"/></td>
    <td><xsl:value-of select="Real_size1"/></td>      
    <td><xsl:value-of select="Recommended_size1"/></td>
    <td><xsl:value-of select="Best_size1"/></td>
		<td><xsl:value-of select="Sup_time1"/></td>
    <td><xsl:value-of select="Sup_compression1"/></td>
    <td><xsl:value-of select="Reg_time1"/></td>
    <td><xsl:value-of select="Reg_compression1"/></td>
	  </tr>
	  </xsl:for-each>
        
        <xsl:for-each select="Result">
	  <tr>
		<td><xsl:value-of select="Date2"/></td>
    <td><xsl:value-of select="ExperimentCount2"/></td>
		<td><xsl:value-of select="AlgName2"/></td>
		<td><xsl:value-of select="Config/Processor"/></td>
		<td><xsl:value-of select="Config/Hdd"/></td>
		<td><xsl:value-of select="Config/Memory"/></td>
    <td><xsl:value-of select="MethodName2"/></td>
    <td><xsl:value-of select="ElapsedTime2"/></td>
    <td><xsl:value-of select="Real_size2"/></td>      
    <td><xsl:value-of select="Recommended_size2"/></td>
    <td><xsl:value-of select="Best_size2"/></td>
		<td><xsl:value-of select="Sup_time2"/></td>
    <td><xsl:value-of select="Sup_compression2"/></td>
    <td><xsl:value-of select="Reg_time2"/></td>
    <td><xsl:value-of select="Reg_compression2"/></td>
	  </tr>
	  </xsl:for-each>
    </table>
	<br/>
	<h2>Выборка файлов</h2>
	<table border="1">
      <tr bgcolor="#9acd32">
        <th colspan="2">Файл(ы)</th>
      </tr>
	  <tr>
		<th>Имя</th>
		<th>Размер (байт)</th>
	  </tr>
	  <xsl:for-each select="Result">
	  <tr>
		<xsl:for-each select="Files/File">
		<tr>
			<td><xsl:value-of select="Name"/></td>
			<td><xsl:value-of select="Size"/></td>
		</tr>
		</xsl:for-each>
	  </tr>
	  </xsl:for-each>
	</table>
	<br/>
	<h2>Полученные параметры</h2>
	<table border="1">
      <tr bgcolor="#9acd32">
          <xsl:for-each select="Result">
        <th colspan="3"> Параметры (<xsl:value-of select="AlgName1"/>)</th>
          </xsl:for-each>
      </tr>
	  <tr>
		<th>Имя</th>
    <th>Рекомендуемое</th>
		<th>Найденное</th>
	  </tr>
	  <xsl:for-each select="Result">
	  <tr>
		<xsl:for-each select="Parameters1/Parameter1">
		<tr>
			<td><xsl:value-of select="Name1"/></td>
      <td><xsl:value-of select="Default1"/></td>
			<td><xsl:value-of select="Value1"/></td>
		</tr>
		</xsl:for-each>
	  </tr>
	  </xsl:for-each>
	</table>
      
    <table border="1">
      <tr bgcolor="#9acd32">
          <xsl:for-each select="Result">
        <th colspan="3"> Параметры (<xsl:value-of select="AlgName2"/>)</th>
          </xsl:for-each>
      </tr>
	  <tr>
		<th>Имя</th>
    <th>Рекомендуемое</th>
		<th>Найденное</th>
	  </tr>
	  <xsl:for-each select="Result">
	  <tr>
		<xsl:for-each select="Parameters2/Parameter2">
		<tr>
			<td><xsl:value-of select="Name2"/></td>
      <td><xsl:value-of select="Default2"/></td>
			<td><xsl:value-of select="Value2"/></td>
		</tr>
		</xsl:for-each>
	  </tr>
	  </xsl:for-each>
	</table>
      
  </body>
  </html>
 </xsl:template>
</xsl:stylesheet>